Compute spatial average of glaciers variables
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=short), | intent(in) | :: | dt |
time step (s) |
||
type(grid_real), | intent(in) | :: | iwe |
ice water equivalent (m) |
||
type(grid_real), | intent(inout) | :: | water |
free water in ice (m) |
||
type(grid_real), | intent(in) | :: | iceMelt |
ice melt in the time step (m) |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=short), | public | :: | c | ||||
integer(kind=short), | public | :: | count | ||||
integer(kind=short), | public | :: | i | ||||
real(kind=float), | public | :: | icearea | ||||
integer(kind=short), | public | :: | r |
SUBROUTINE ComputeSpatialAverageGlaciers & ! (dt, iwe, water, iceMelt) IMPLICIT NONE !arguments with intent in: INTEGER (KIND = short), INTENT(IN) :: dt !!time step (s) TYPE (grid_real), INTENT(IN) :: iwe !! ice water equivalent (m) TYPE (grid_real), INTENT(INOUT) :: water !! free water in ice (m) TYPE (grid_real), INTENT(IN) :: iceMelt !! ice melt in the time step (m) !local declarations INTEGER (KIND = short) :: i, r, c INTEGER (KIND = short) :: count REAL (KIND = float) :: icearea ![m2] !-------------------------------end of declaration----------------------------- DO i = 1, nextents count = 0 !ice water equivalent IF ( iceout (1) ) THEN count = count + 1 extents (i) % ice (count) = & GetMean (iwe, maskInteger = extents (i) % mask ) * 1000. END IF !glacier covered percentage IF ( iceout (2) ) THEN !compute glacier covered area icearea = 0. DO r = 1, extents (i) % mask % idim DO c = 1, extents (i) % mask % jdim IF (extents (i) % mask % mat (r,c) /= extents (i) % mask % nodata) THEN IF (iwe % mat (r,c) > 0.) THEN icearea = icearea + CellArea (extents (i) % mask, r, c) END IF END IF END DO END DO !compute snow covered percentage count = count + 1 extents (i) % ice (count) = icearea / extents (i) % area END IF !free water in ice pack IF ( iceout (3) ) THEN count = count + 1 extents (i) % ice (count) = & GetMean (water, maskInteger = extents (i) % mask ) * 1000. END IF !ice melt IF ( iceout (4) ) THEN count = count + 1 extents (i) % ice (count) = & GetMean (iceMelt, maskInteger = extents (i) % mask ) * 1000. END IF END DO RETURN END SUBROUTINE ComputeSpatialAverageGlaciers